const EventEmitter = require('events');

class MyEventEmitter extends EventEmitter {}

const myEventEmitter = new  MyEventEmitter();

myEventEmitter.on('error', (err, date)=> {
  console.log(err.name, err.message, date);
});

// emit方法的第二个参数开始可以指定多个参数传递
myEventEmitter.emit('error', new Error('WTF!!!'), new Date().toUTCString());
